package task;

import java.util.Scanner;

public class Task5_5 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        System.out.println(resoveAdd(n));
    }
    public  static int resoveAdd(int n){
        if(n == 0){
            return 0;
        }
        return n % 10 + resoveAdd(n / 10);
    }
}
